﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Vote.aspx.cs" Inherits="OVS.Vote" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <link href="~/OVS.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <center>
            <asp:Label ID="lblMsg" runat="server" CssClass="message"></asp:Label>
            <asp:Label ID="lblErrMsg" runat="server" CssClass="error"></asp:Label>
            <asp:ValidationSummary ID="vsmErrors" runat="server" CssClass="summarymessage" Style="text-align: left;
                width: 20%" />
                
            <div id="divHaveVoted" runat="server" visible="false">
                <asp:Label ID="lblHaveVoted" runat="server" Text="You have voted for this election!"></asp:Label>
            </div>
            <div id="divVote" runat="server">
             <div>
                    <asp:Label ID="Label1" runat="server" CssClass="ParaTitle"> Vote </asp:Label>
                    </div>
            <table cellpadding="2" cellspacing="2">
                <tr>
                    <td colspan="2">
                        <OVSControl:SelectWard ID="SelectWard" runat="server" />
                    </td>
                </tr>
            </table>
            <table width="90%">
            <tr>
                <td colspan="2">
                    <asp:GridView ID="gvCandidateList" Width="94%" runat="server" AutoGenerateColumns="false"
                    BorderColor="Black" DataKeyNames="CandidateId" >
                    <HeaderStyle BackColor="White" Font-Size="10px" ForeColor="#990000" BorderStyle="None" />
                    <RowStyle BackColor="#F7F3F7" Font-Names="Verdana" Font-Size="XX-Small" BorderStyle="None" />
                    <AlternatingRowStyle BackColor="White" Font-Names="Verdana" Font-Size="XX-Small"
                        BorderStyle="None" />
                  
                    <Columns>
                   
                    <asp:TemplateField HeaderStyle-Width="20%" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Center"
                            ItemStyle-BorderStyle="None" HeaderStyle-BorderStyle="None">
                            <HeaderTemplate>
                                <asp:Label runat="server" ID="CandidateID" Text="Candidate ID"></asp:Label><br />                                
                            </HeaderTemplate>
                            <ItemTemplate>
                              <asp:Label ID="lblCandidateId" Text='<%# DataBinder.Eval(Container.DataItem, "CandidateId") %>'
                               Width="100px" Height="100px" runat="server" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        
                        <asp:TemplateField HeaderStyle-Width="20%" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Center"
                            ItemStyle-BorderStyle="None" HeaderStyle-BorderStyle="None">
                            <HeaderTemplate>
                                <asp:Label runat="server" ID="CandidatePhoto" Text="Candidate Photo"></asp:Label><br />                                
                            </HeaderTemplate>
                            <ItemTemplate>
                              <asp:Image ID="imgPhoto" ImageUrl='<%# DataBinder.Eval(Container.DataItem, "Voter.Photo") %>' Width="100px" Height="100px" runat="server" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        
                          <asp:TemplateField HeaderStyle-Width="20%" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Center"
                            ItemStyle-BorderStyle="None" HeaderStyle-BorderStyle="None">
                            <HeaderTemplate>
                                <asp:Label runat="server" ID="Symbol"   Text="Symbol"></asp:Label><br />                                
                            </HeaderTemplate>
                            <ItemTemplate>
                              <asp:Image ID="imgSymbol" ImageUrl='<%# DataBinder.Eval(Container.DataItem, "Symbol") %>' Width="100px" Height="100px" runat="server" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        
                          <asp:TemplateField HeaderStyle-Width="20%" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Center"
                            ItemStyle-BorderStyle="None" HeaderStyle-BorderStyle="None">
                            <HeaderTemplate>
                                <asp:Label runat="server" ID="Details" Text="Details"></asp:Label><br />                                
                            </HeaderTemplate>
                            <ItemTemplate>
                                <table >
                                    <tr>
                                        <td>
                                             <asp:label ID="Label2" runat="server" Text="Name" />   :
                                            <asp:label ID="candidateName" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Voter.Name") %>' />                                            
                                        </td>
                                    </tr>
                                     <tr>
                                        <td>
                                             <asp:label ID="Label3" runat="server" Text="Party" />   :
                                            <asp:label ID="Label1" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Party") %>' />                                            
                                        </td>
                                    </tr>
                                </table>
                            </ItemTemplate>
                        </asp:TemplateField>
                        
                        <asp:TemplateField HeaderStyle-Width="20%" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Center"
                            ItemStyle-BorderStyle="None" HeaderStyle-BorderStyle="None">
                            <HeaderTemplate>
                                 <asp:Label runat="server" ID="Voter" Text="Vote"></asp:Label><br />  
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:RadioButton runat="server" ID="rdoVote"    AutoPostBack="true" EnableViewState="true"
                                  OnCheckedChanged="rdoVote_OnCheckedChanged"  />
                            </ItemTemplate>
                        </asp:TemplateField>
                       
                    </Columns>
                </asp:GridView>
                </td>
            </tr>
            <tr >
                <td colspan="2">
                  
                    
                </td>
            </tr>
            </table>
                    <asp:HiddenField ID="hidCandidateId" runat="server" />
              <asp:Button ID="btnVote" Text="Vote" runat="server" OnClick="btnVote_click" />
                    <asp:Button ID="btnReset" Text="Reset" runat="server" />
                    <asp:Button ID="btnCancel" Text="Cancel" runat="server" />
                    </div>                
        </center>
    </div>
    </form>
</body>
</html>
